<?php
namespace app\exception;

use app\extensions\lib\Output;
use Throwable;
use Exception;
use Webman\Exception\ExceptionHandlerInterface;
use Webman\Http\Response;
use Webman\Http\Request;

class ApiException extends Exception
{

    /**
     * @param Throwable $e
     * @return mixed
     */
    public function report(Throwable $e)
    {
        // TODO: Implement report() method.
    }

    /**
     * @param Request $request
     * @param Throwable $e
     * @return Response
     */
    public function render(Request $request, Throwable $e): Response
    {
        return Output::exception([
            $request->all()
        ],$this->getCode(),$this->getMessage());
    }
}